package j.framework.log;

import org.apache.log4j.Category;
import org.apache.log4j.Priority;
import org.apache.log4j.spi.LoggingEvent;

/**
 * User: jason
 * Date: 13-5-2 下午5:26
 */
public class RabbitLoggingEvent extends LoggingEvent {
    private static final long serialVersionUID = -1405127865403337639L;

    public RabbitLoggingEvent(String fqnOfCategoryClass, Category logger, Priority level, Object message, Throwable throwable) {
        super(fqnOfCategoryClass, logger, level, message, throwable);
    }


    public String getThreadName() {
        String thrdName=super.getThreadName();
        if(thrdName.contains("'")){
            thrdName=thrdName.replaceAll("'", "''");
        }
        return thrdName;
    }

    public String getRenderedMessage() {
        String msg=super.getRenderedMessage();
        if(msg.contains("'")){
            msg=msg.replaceAll("'", "''");
        }
        return msg;
    }
}
